package ink.tiptop.learn.convert.test;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @author zjf
 * @date 2020-08-15 17:32
 */
@Mapper
//@Mapper(imports = TimeAndFormat.class) //如果这里不导入的话,下面使用需要用到的类需要用全限定名称
public interface A_ExpressConvert {
    A_ExpressConvert INSTANCE = Mappers.getMapper( A_ExpressConvert.class );

    /**
     表达式写法,可以自定义转换方法,以java代码的形式写在expression后面,
     写法就是 expression = "java(...)"
     * @param s
     * @return
     */
//    @Mapping(target = "timeAndFormat",
//            expression = "java( new org.sample.TimeAndFormat( s.getTime(), s.getFormat() ) )")
//    Target sourceToTarget(Source s);
}
